﻿<%@ WebHandler Language="C#" Class="Issued_Use" %>

using System;
using System.Web;
using System.Web.SessionState;
public class Issued_Use : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
        
        /* 安全验证 */
        if (!Admins.IsLogin(true))
            Utils.ShowEnd(context, -2);

        int item_id = Convert.ToInt32(context.Request.Params["item_id"].ToString().Trim());
        int column_id = Convert.ToInt32(context.Request.Params["column_id"].ToString().Trim());
        int item_lang = Convert.ToInt32(context.Request.Params["item_lang"].ToString().Trim());
        
        Verification verification = new Verification();
        if (!verification.VerificationMinMaxValue(item_id, 1, 60000))
            Utils.ShowEnd(context, -1);
        if (!verification.VerificationMinMaxValue(column_id, 1, 2000)) 
            Utils.ShowEnd(context, -1);
        if (!verification.VerificationMinMaxValue(item_lang, 1, 254))
            Utils.ShowEnd(context, -1);
        
        
        Issued issued=new Issued();
        int status=issued.Use(item_id,column_id,Admins.IsLogin(),item_lang);
        Utils.ShowEnd(context,status);
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}